from flask import Flask
from flask_session import Session
from flask_sqlalchemy import SQLAlchemy
from config import dict_config


db = SQLAlchemy()

def create_app(mode):
    app = Flask(__name__)
    app.config.from_object(dict_config[mode])
    Session(app)
    db.init_app(app)
    from info.modules.news import Blue_print
    app.register_blueprint(Blue_print)

    return app